%table.table
  - if @group.created_at
    %tr
      %td= t('groups.show.details.created_at')
      %td= @group.created_at.to_s(:date)
  - if @group.creator
    %tr
      %td= t('groups.show.details.created_by')
      %td= link_to(@group.creator.name, @group.creator)
  - if (leaders = @group.leaders.to_a).any?
    %tr
      %td= t('groups.show.details.leader', count: leaders.size)
      %td= safe_join(leaders.map { |p| link_to(p.try(:name), p) }, ', ')
  - if (admins = @group.admins.to_a).any? && admins != leaders
    %tr
      %td= t('groups.show.details.admins')
      %td= safe_join(admins.map { |p| link_to(p.try(:name), p) }, ', ')
  %tr
    %td= t('groups.show.details.member_count_label')
    %td
      = link_to t('groups.show.details.member_count', count: @group.people.count), group_memberships_path(@group)
      - if @group.people.any?
        = t('groups.show.details.birthdays_this_month_html', count: @group.people.with_birthday_month(Time.now.month).count, url: group_memberships_path(@group, birthdays: true))
      - if @group.linked?
        = icon 'fa fa-link', title: t('groups.show.linked.tooltip', code: @group.link_code)
      - elsif @group.parents_of?
        = icon 'fa fa-link', title: t('groups.show.parents_of.tooltip', group: @group.parents_of_group.try(:name))
      - if @group.attendance? and @group.admin?(@logged_in)
        %p
        = link_to t('groups.show.details.attendance.button'), group_attendance_index_path(@group), class: 'btn btn-xs btn-info'
  - if @group.meets.present?
    %tr
      %td= t('groups.show.details.meets')
      %td= preserve_breaks(@group.meets)
  - if @group.location.present?
    %tr
      %td= t('groups.show.details.location')
      %td= preserve_breaks(@group.location)
  - if @group.directions.present?
    %tr
      %td= t('groups.show.details.directions')
      %td= preserve_breaks(@group.directions)
  - if @group.document_folders.any? && can_see_group_documents?(@group)
    %tr
      %td= t('groups.show.details.attachments')
      %td
        %ul.list-unstyled
          - @group.document_folders.each do |folder|
            %li
              = link_to documents_path(folder_id: folder.id) do
                = icon 'fa fa-folder'
                = folder.name

